import request from '@/common/request.js'	

/**
 获取项目列表
 */
export function getProjectList(params){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/project",
			method: "get",
			data: params
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 获取工地阶段详情
 */
export function getProjectDetail(params){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectDetail",
			method: "get",
			data: params	
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 阶段详情
 */
export function getProjectService(params){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectService",
			method: "get",
			data: params			
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 保存阶段详情
 */
export function projectService(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectService",
			method: "post",
			data			
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 修改阶段计划状态
 */
export function projectImplement(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectImplement",
			method: "POST",
			data			
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 获取阶段列表
 */
export function getModelProject(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/modelProject",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 首页-数据统计
 */
export function getStatistics(){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/statistics",
			method: "get"	
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工地列表
 */
export function getServiceList(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/crmService",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工地详情
 */
export function getCrmServiceInfo(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/crmServiceInfo",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工地开工申请
 */
export function serviceOpen(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/serviceOpen",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工地完工申请
 */
export function serviceClose(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/serviceClose",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 查看施工现现场
 */
export function deviceLook(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "customer/deviceLook",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}



/**
 * 获取未开工项目列表
 */
export function getNotStartedList(){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/newBuildList",
			method: "get"	
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 未开工工作日模板创建
 */
export function newBuild(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/newBuild",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工作日期模板列表
 */
export function modelList(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/modelList",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}


/**
 * 阶段开工申请
 */
export function projectOpen(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectOpen",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 阶段完工申请
 */
export function projectClose(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectClose",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 申请 打拆开工
 */
export function tearOpen(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/tearOpen",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 取消 打拆阶段
 */
export function tearClose(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/tearClose",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 某工地—— 打拆阶段详情
 */
export function tearInfo(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/tearInfo",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 申请 水电开工
 */
export function waterOpen(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/waterOpen",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}




/**
 * 工地列表-待指派人员
 */
export function getAssignList(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/assignList",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 工地列表-指派项目经理
 */
export function setManager(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/setManager",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 工地列表-指派工程监理
 */
export function setSurveyor(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/setSurveyor",
			method: "post",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 工程监理 列表
 */
export function supplierList(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/supplierList",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}
/**
 * 项目经理 列表
 */
export function managerList(data){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/managerList",
			method: "get",
			data
		}).then(res => {
			return resolve(res)
		})
	})		
}

/**
 * 获取工地日报
 */
export function getProjectLog(params){
	return new Promise(function(resolve, reject) {
		request({
			url: "api/projectLog",
			method: "get",
			data: params
		}).then(res => {
			return resolve(res)
		})
	})		
}